@extends('base.base')
@section('base')
    <!-- 内容区域 -->
    <div class="main-panel">
        <div class="content-wrapper">
            <div class="page-header">
                <h3 class="page-title">
                     <span class="page-title-icon bg-gradient-primary text-white mr-2">
                        <i class="mdi mdi-settings"></i>
                    </span>
                    黑名单统计
                </h3>
                <nav aria-label="breadcrumb">
                    <ol class="breadcrumb">
                        <li class="breadcrumb-item"><a href="#">黑名单统计管理</a></li>
                        <li class="breadcrumb-item active" aria-current="page">黑名单统计列表</li>
                    </ol>
                </nav>
            </div>
            <div class="row">
                <div class="col-lg-12 grid-margin stretch-card">
                    <div class="card">
                        <div class="card-body">
                            <h4 class="card-title">黑名单统计列表</h4>
                            <div class="col-lg-7" style="float: left;padding: 0;">
                            </div>
                            <div class="col-lg-5" style="float: right">
                                <form action="">
                                    <div class="form-group row">
{{--                                        <div class="col-sm-3">--}}
{{--                                            <label class="col-form-label">渠道</label>--}}
{{--                                            <select class="form-control" id="channel_id" name="channel_id">--}}
{{--                                                <option value="0">全部</option>--}}
{{--                                                @foreach($channels as $channelRes)--}}
{{--                                                    <option value="{{$channelRes->id}}" @if($channelId==$channelRes->id)  selected @endif>{{$channelRes->name}}</option>--}}
{{--                                                @endforeach--}}
{{--                                            </select>--}}
{{--                                        </div>--}}
                                        <div class="col-sm-9">
                                            <label class="col-form-label">日期</label><span class="btn btn-danger btn-sm" id="date_sel" style="margin-left: 20px">清空日期</span>
                                            <input class="form-control selector" type="text" name="access_date" id="access_date" value="{{$accessDate}}"/>
                                        </div>
                                        <input type="hidden" name="app_id"  value="{{ $appId }}">
                                        <div class="col-sm-3">
                                            <label class="col-form-label"></label>
                                            <button class="btn btn-sm btn-gradient-primary mb-2" type="submit"><i class="mdi mdi-account-search btn-icon-prepend"></i>
                                                搜索
                                            </button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                            <table class="table table-bordered">
                                <thead>
                                <tr>
                                    <th>时间</th>
                                    <th>总次数</th>
                                </tr>
                                </thead>
                                <tbody>
                                @foreach($list as $k=>$v)
                                    <tr>
                                        <td>
                                            {{ $v->access_date }}
                                        </td>
                                        <td>
                                            {{ $v->total ?? '' }}
                                        </td>
                                    </tr>
                                @endforeach
                                </tbody>
                            </table>
                            <div class="box-footer clearfix">
                                总共 <b>{{ $list->appends(["access_date"=>$accessDate, "channel_id" =>$channelId, 'app_id' => $appId])->total()  }}</b> 条,分为<b>{{ $list->lastPage() }}</b>页
                                {!! $list->links() !!}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

<script>
    $(".selector").flatpickr({});

    $("#date_sel").bind("click", function () {
        $("#access_date").val("");
    })


</script>
@endsection
